"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import login, index,carts,order

urlpatterns = [
    # 登录
    url(r'^login/$', login.myhome_login, name="myhome_login"),
    url(r'^logout/$', login.myhome_logout, name="myhome_logout"),
    url(r'^register/$', login.myhome_register, name="myhome_register"),
    # 水果和蔬菜
    url(r'^fruits/', index.fruits, name="fruits"),
    # 食物产品
    url(r'^products/', index.products, name="products"),
    # 找到商店
    url(r'^store/', index.store, name="store"),
    # 粉丝俱乐部
    url(r'^club/', index.club, name="club"),
    # 联系我们
    url(r'^contact/', index.contact, name="contact"),
    # 列表
    url(r'^mylist/(?P<cid>[0-9]+)', index.mylist, name="mylist"),
    # 文章
    url(r'^article/', index.article, name="article"),
    # 加入购物车
    url(r'^addcarts/', carts.cart_add, name="cart_add"),
    # 购物车列表页
    url(r'^carts/$', carts.cart_index, name="cart_index"),
    #购物车数量编辑
    url(r'^carts/edit/', carts.cart_edit, name="cart_edit"),
    # 物品删除
    url(r'^carts/del/', carts.cart_del, name="cart_del"),
    #订单确认页
    url(r'^order/confirm/', order.order_confirm, name="order_confirm"),
    # 首页
    url(r'^', index.index, name="index"),


]
